HTML Production for Java
Purpose
The HTML Production for Java class library is an open source class library that encapsulates the gory details of creating HTML for use in JSP and Servlets. Access to the project is provided courtesy of Source Forge.

HTML Production for Java allows developers to create complicated HTML structures by combining relatively simple objects together. For example, most sites have a consistent look for all of the input forms for the site. Rather than typing lots of HTML in the Servlets or JSPs, the developer should be able to use our HTML production library to encapsulate the presentation logic for the input forms. In the following example, the UI developer describes a form in terms of defined fields and then asks a Form object to generate the HTML for the form.

The client code would look like:

FormDescription form_description = new FormDescription("data", "Data", "Please enter some data. "); InputGroupDescription personal_group =
new InputGroupDescription("Personal Information", "Please enter your personal information");
personal_group.addInputDescription(FieldDescription.FIRST_NAME);
personal_group.addInputDescription(FieldDescription.MIDDLE_INITIAL);
personal_group.addInputDescription(FieldDescription.LAST_NAME);
personal_group.addInputDescription(SelectionDescription.GENDER);
personal_group.addInputDescription(FieldDescription.AGE);
personal_group.addInputDescription(SelectionDescription.SALARY_RANGE);
personal_group.addInputDescription(SelectionDescription.TECHNICAL_EXPERTISE);

form_description.addGroup(personal_group);

Form form = new Form("/silly/formValidationServlet", form_description, current_values);
form.addButton("submit", "Submit");

Page page = new Page("Test Form", "./Default.css");
page.addToBody(form);
page.buildContent(buffer);

This allows the form to be constructed very easily and very naturally, without any knowledge of HTML. Developers can use a similar approach to develop their own reusable HTML producers for page layouts, fancy navigation bars, etc. These producers can be used from both Servlets or JSPs.

While this project will provide some high level structures, it is mostly focused on providing solid building blocks that YOU can use to build interesting project level components as described above. For example, it encapsulates the complexity of the table tag inside of a Table class that allows you to add any HTML producer to specific spots in the table:

Table layout = new Table();
layout.setWidth(700);

Link link = new Link("./about.html");
link.add(new Text(Style.LINK, "About us");

Image spot = new Image("/images/spot.jpeg");

layout.setProducerAt(0,0, link);
layout.setProducerAt(1,1, spot);

Enjoy!

See the latest code
You can browse the latest code in SourceForge's web enabled CVS repository.
Raw Source The raw source for the project
Unit Test Cases The JUnit test cases for the project
Unit Test Results The results from the test cases for the project


Release Schedule
VersionFeature Description Date
1.1 Fundamental HTML content and layout structures. 15 Feb 03
1.2 Data input forms with client side validation. 22 May 03
1.3 Server side validation of form data. 1 June 03
1.4 Client and server side validation rules at group level. Coming soon
1.5 Application properties, static content, inline style sheets, nifty widgets. Coming soon
1.6 Servlet examples for forms and basic layout. Coming soon
1.7 JSP examples for forms and basic layout. Coming soon
2.0 Dynamic images. To Be Determined
2.1 Advanced layout components. To Be Determined
SourceForge.net Logo

Open Source Logo

Source Forge Project Page

Download

Our License

Copyright © 2003 by the HtmlProduction Crew
Contact Us
The contents of this website are licensed under the Open Software License version 1.1.